1. Field of the Invention
The present embodiment of invention relates to generating strokes in real-time on an electronic paper display. In particular the present invention relates to generating strokes on an electronic paper display by converting stroke input to binary code and filling in pixels using a grayscale.
2. Description of the Background Art
The use of electronic paper display devices has become commonplace for many users. Examples of present-day electronic paper display devices include electronic devices for reading such as the Reader™ from Sony Corp., the Kindle™ from Amazon and the Nook™ from Barnes & Noble. There have also been increased sales of tablet computers offering different levels of processing capability and size.
The screens on the electronic paper displays are composed of pixels. When an image is converted from vector data into pixel data, i.e. rasterized, the image is broken down and displayed in the pixels. FIG. 1A is a prior art example of a rasterized image. Lines drawn on a display, for example lines tracing the path of a stylus used to generate electronic “ink” on the display, can be rendered with minimal computation using a number of algorithms, the most well known being Bresenham's Line Algorithm. Similar algorithms are well known for rendering curved lines that have been interpolated from a set of sample locations generated by a stylus or other stroke capture device. One well-known problem with such rasterization algorithms are the appearance of “jaggies”: stair-like visual artifacts that appear where there should be smooth straight lines or curves. Jaggies are a natural result of rendering non-vertical or horizontal lines using a regular grid of pixels, and they can be quite noticeable even on moderate resolution displays.
One prior art attempt to fix the jaggies problem is called anti-aliasing and refers to a process of using intermediate levels of gray around the edges of the line to blend the pixels together. Anti-aliasing smoothes out jagged lines by surrounding them with semi-transparent pixels to simulate the appearance of fractionally-filled pixels. The result is what appears to be smoother lines than would be possible given the display's spatial resolution, albeit at a cost of lowering spatial contrast. FIG. 1B is a prior art example of the result of applying anti-aliasing to the @ symbol.
One anti-aliasing technique for rendering images is called supersampling because each unit of the image that is rasterized for a pixel is sampled multiple times in different parts of the unit and the sampled colors are averaged. In order to properly sample the image, the image is rendered at a high resolution and then downsampled for display. The amount of buffer required for supersampling is larger than other rasterizing techniques. As a result, supersampling is computationally expensive.
In the sub-domain of line drawing, several algorithms attempt to avoid the computational overhead of supersampling by computing the transparency of pixels along the edges of a rasterized line as a function of the distance of the pixel from the center of the ideal line. When drawing simple lines and curves these methods produce a reasonable approximation to what would be obtained using supersampling, and are much more efficient Inking, that is rendering the path of a stylus or similar stroke capture device in near real-time to a display, presents challenges that are not properly handled by the above-described algorithms. In particular, inking involves rendering a foreground image (the ink) against a background image (the document or graphics upon which the ink is being “written”). As the tablet generates samples, ink is rendered to the display as narrow bands overlayed on top of the background. When anti-aliasing is performed correctly, the color of a pixel that would only be partially covered by the ideal path of a pen stroke should be a combination of the ink color and the background color, the combination determined by the amount of ink covering the pixel.
For example, if black ink were to cover 50% of a white pixel the resulting color might be mid-gray. Typically the above-described algorithms would perform such blending and then write the resulting color to the frame buffer as the new pixel color. This presents a problem when ink overlaps with ink that has previously been rendered, as it would when drawing an “X” or “K.” In such a case, the amount of additional coverage of the pixel depends on where on the pixel the previous ink covered, and may result in anywhere from no change to the pixel color (if the new ink only affected pixel regions already inked) to a completely additive effect if the new and old ink cover entirely different regions of the pixel. Some prior art attempts to address this problem propose identifying whether a rendered pixel has previously been inked by reserving a set of entries in the color table solely for ink and then only applying new ink if it would result in a darker color than currently rendered. This heuristic avoids unsightly dark spots where ink crosses other ink, but in many cases it leaves the pixels of intersection lighter than proper anti-aliasing would produce.